/* =========================
   VARIABLES / BASE
   ========================= */

:root {
  --bg-main: #050509;
  --bg-section: #080b12;
  --accent-blue: #3aa6ff;
  --accent-orange: #ff8c32;
  --accent-yellow: #ffd447;
  --text-main: #f5f5f5;
  --text-muted: #c3c3c3;
  --card-bg: #101522;
  --card-border: rgba(255, 255, 255, 0.06);
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.5);
}

/* =========================
   RESET & BASE
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #15192a 0, #050509 52%);
  color: var(--text-main);
  line-height: 1.6;
}

.container {
  width: min(1120px, 100% - 3rem);
  margin: 0 auto;
}

/* =========================
   HEADER
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 5, 9, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

/* =========================
   LOGO – Imagen + eslogan
   ========================= */

.logo {
  display: flex;
  flex-direction: column;   /* 🔥 logo arriba, texto abajo */
  align-items: center;      /* centrado con el texto */
  gap: 0.2rem;              /* espacio entre logo y texto */
}

.logo img {
  height: 40px;             /* 🔥 controla el tamaño del logo */
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-weight: 500;
  white-space: nowrap;       /* evita que "Marketing Digital" se parta */
}


/* =========================
   Navegacion principal
   ========================= */

.main-nav {
  display: flex;
  gap: 1.3rem;
  font-size: 0.86rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--accent-blue),
    var(--accent-orange),
    var(--accent-yellow)
  );
  transition: width 0.25s ease-out;
}

.main-nav a:hover {
  color: var(--text-main);
}

.main-nav a:hover::after {
  width: 100%;
}

/* Botón hamburguesa */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
  margin: 4px 0;
}

/* =========================
   HERO
   ========================= */

.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 2; /* por encima del video */
}

/* Video de fondo */

.hero-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.45; /* intensidad del video */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.35));
  z-index: 1;
}

/* Texto hero */

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 3vw + 1rem, 2.9rem);
  line-height: 1.15;
  margin: 0 0 0.9rem;
}

.hero-sub {
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 1.8rem;
}

/* CTA botones */

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out,
    background 0.2s ease-out, border-color 0.2s ease-out;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--accent-yellow),
    var(--accent-orange)
  );
  color: #000000;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.623);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 10px 20px rgb(16, 97, 247);
}

/* =========================
   SECCIONES – Layout general
   Aplica a cualquier <section class="section">
   ========================= */

.section {
  /* Espaciado vertical uniforme para todas las secciones */
  padding: 4rem 0;
  background: transparent; /* Fondo por defecto (lo alternamos abajo) */
}

/* Fondo alternado: secciones 1, 3, 5… tienen un degradado suave */
.section:nth-of-type(odd) {
  background: radial-gradient(circle at top left, #111627 0, #050509 55%);
}

/* Título principal dentro de cada sección (ej: "Servicios", "Clientes") */
.section h2 {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

/* Subtítulo o descripción corta bajo el h2 (class="section-sub") */
.section-sub {
  color: var(--text-muted);
  margin-bottom: 2.2rem;
}

/* =========================
   GRIDS – Layout de columnas
   ========================= */

/* Grid de 2 columnas
   Usado, por ejemplo, en "Acerca de mí":
   - Columna 1: texto
   - Columna 2: foto
*/
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

/* Grid genérico de tarjetas (Servicios, Clientes, etc.) */
.grid-3 {
  display: grid;
  gap: 1.6rem;
}

/* Desktop / pantallas grandes:
   .grid-3 se organiza en 3 columnas
*/
@media (min-width: 769px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablets / móvil:
   .grid-3 pasa a 1 tarjeta por fila
*/
@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   ABOUT
   ========================= */

.about-text h3 {
  margin-top: 0.2rem;
  color: var(--accent-yellow);
  font-weight: 600;
}

.about-text p {
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* Marco cuadrado con esquinas redondeadas */
.profile-frame {
  width: 230px;
  height: 230px;
  position: relative;
  border-radius: 25px;
  overflow: hidden;
  margin: 0 auto;
  background: #000;
  box-shadow: var(--shadow-soft);
}

/* Imagen dentro del marco: estilo original + animación */
.profile-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;       /* mismo encuadre que tenías */
  object-position: center;

  opacity: 0;              /* para el fade con scroll */
  transform: scale(0.98);  /* micro-zoom de entrada */
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Estado base de los textos (para que también se animen) */
.about-text h2,
.about-text h3,
.about-text p {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Cuando la sección ABOUT entra en vista */
.about.fade-section.in-view .about-text h2,
.about.fade-section.in-view .about-text h3,
.about.fade-section.in-view .about-text p {
  opacity: 1;
  transform: translateY(0);
}

.about.fade-section.in-view .profile-frame img {
  opacity: 1;
  transform: scale(1);  /* solo zoom suave, sin mover encuadre */
}

/* =========================
   CARDS / SERVICIOS
   ========================= */

.services {
  /* hereda backgrounds de .section */
}

.service-grid .card,
.client-grid .card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.3rem 1.45rem;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.service-grid .card.fade-section.in-view:hover,
.client-grid .card.fade-section.in-view:hover {
  transform: translateY(-4px) scale(1.03);

  border: 1px solid var(--accent-blue);     /* borde azul igual al botón */
  background: rgba(255, 255, 255, 0.04);    /* ligero brillo como el botón */

  box-shadow:
    0 10px 20px rgba(16, 97, 247, 0.45);    /* azul suave igual al btn-outline */
  
  transition: all 0.23s ease-out;
}




.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

/* =========================
   CLIENTES
   ========================= */

.clients {
  /* hereda estilos base */
}

/* =========================
   CTA FINAL
   ========================= */

.cta-final {
  text-align: center;
}

.cta-inner p {
  max-width: 32rem;
  margin: 0.4rem auto 1.8rem;
}

/* =========================
   CONTACTO – SECCIÓN
   ========================= */

.contact-section {
  text-align: left;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.contact-col p {
  margin: 0.4rem 0;
  color: var(--text-muted);
}

.contact-col h3 {
  margin-bottom: 0.8rem;
}

/* =========================
   FOOTER
   ========================= */

/* Layout general */

.site-footer {
  padding: 2.4rem 0 2rem;
  background: #030308;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

/* Bloque de contacto dentro del footer */

.footer-inner {
  display: flex;
  justify-content: center;      /* columnas centradas */
  align-items: flex-start;      /* ambas arrancan arriba */
  gap: 3rem;
  margin-bottom: 2.4rem;
}

.footer-left,
.footer-right {
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
}

.footer-left h3 {
  margin: 0 0 0.6rem 0;
}

.footer-left p,
.footer-right p {
  margin: 0.35rem 0;
  text-align: left;
}

/* WhatsApp: soporte para salto con <br class="wh-br"> */

.wh-wrapper {
  /* Desktop: sin cambios especiales */
}

.wh-br {
  display: none;  /* se muestra solo en mobile */
}

/* Derechos reservados */

.footer-copy-bar {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 1rem;
}

.footer-copy-bar p {
  margin: 0;
  text-align: right;
  margin-right: 1rem;
  color: var(--text-muted);
}

/* =========================================
   SCROLL REVEAL GENERAL (.fade-section)
   ========================================= */

.fade-section {
  opacity: 0;
  transform: translateY(26px) scale(0.97);
  transition:
    opacity 0.55s ease-out,
    transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.fade-section.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Un poquito más suave en móviles */
@media (max-width: 768px) {
  .fade-section {
    transform: translateY(18px);
  }
}

/* =========================================
   HERO: animación al cargar (tipo Dulce)
   ========================================= */

.hero-inner {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition:
    opacity 0.55s ease-out,
    transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.hero-inner.hero-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =========================================
   CARDS: entran desde lados + POP en hover
   ========================================= */

/* Estado base (además del fade-section) */
.service-grid .card.fade-section,
.client-grid .card.fade-section {
  /* heredan opacity/scale de .fade-section */
}

/* Odd: desde la izquierda */
.service-grid .card.fade-section:nth-child(odd),
.client-grid .card.fade-section:nth-child(odd) {
  transform: translateX(-32px) translateY(26px) scale(0.96);
}

/* Even: desde la derecha */
.service-grid .card.fade-section:nth-child(even),
.client-grid .card.fade-section:nth-child(even) {
  transform: translateX(32px) translateY(26px) scale(0.96);
}

/* Ya en vista (neutralizamos X y Y extra) */
.service-grid .card.fade-section.in-view,
.client-grid .card.fade-section.in-view {
  transform: translateX(0) translateY(0) scale(1);
}

/* =========================================
   ABOUT: animación escalonada (texto + foto)
   ========================================= */

/* Estado base: escondidos y abajo/derecha */
.about-text h2,
.about-text h3,
.about-text p {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.profile-frame img {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Cuando la sección ABOUT está en vista */
.about.fade-section.in-view .about-text h2,
.about.fade-section.in-view .about-text h3,
.about.fade-section.in-view .about-text p {
  opacity: 1;
  transform: translateY(0);
}

.about.fade-section.in-view .profile-frame img {
  opacity: 1;
  transform: translateX(0);
}

/* Orden cuando vas hacia ABAJO (scrolling-down)
   h2 (Acerca de mí) → h3 (nombre) → párrafos → foto
*/
body.scrolling-down .about.fade-section.in-view .about-text h2 {
  transition-delay: 0.25s;
}

body.scrolling-down .about.fade-section.in-view .about-text h3 {
  transition-delay: 0.45s;
}

body.scrolling-down .about.fade-section.in-view .about-text p:nth-of-type(1) {
  transition-delay: 0.65s;
}

body.scrolling-down .about.fade-section.in-view .about-text p:nth-of-type(2) {
  transition-delay: 0.85s;
}

/* si agregas más párrafos, siguen esta lógica */
body.scrolling-down .about.fade-section.in-view .about-text p:nth-of-type(3) {
  transition-delay: 1.05s;
}

body.scrolling-down .about.fade-section.in-view .profile-frame img {
  transition-delay: 1.35s;
}

/* Orden cuando vas hacia ARRIBA (scrolling-up)
   Foto → párrafos → h3 → h2
*/
body.scrolling-up .about.fade-section.in-view .profile-frame img {
  transition-delay: 0.35s;
}

body.scrolling-up .about.fade-section.in-view .about-text p:nth-of-type(1) {
  transition-delay: 0.60s;
}

body.scrolling-up .about.fade-section.in-view .about-text p:nth-of-type(2) {
  transition-delay: 0.80s;
}

body.scrolling-up .about.fade-section.in-view .about-text p:nth-of-type(3) {
  transition-delay: 1.00s;
}

body.scrolling-up .about.fade-section.in-view .about-text h3 {
  transition-delay: 1.25s;
}

body.scrolling-up .about.fade-section.in-view .about-text h2 {
  transition-delay: 1.45s;
}

/* =========================================
   HEADER: ocultar al bajar / mostrar al subir
   (como en Dulce)
   ========================================= */

.site-header {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Oculto (al bajar) */
.header-hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* Visible (al subir) */
.header-visible {
  transform: translateY(0);
  opacity: 1;
}


/* =========================
   RESPONSIVE
   ========================= */

/* Tablets / pantallas medianas */

@media (max-width: 900px) {
  .hero-inner,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    text-align: center;
  }

  .hero-sub {
    margin-inline: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .footer-inner {
    gap: 2rem;
  }
}

/* Mobile general */

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr; /* 1 tarjeta por fila */
  }
}

@media (max-width: 650px) {
  /* Nav móvil */
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .main-nav.is-open {
    display: flex;
  }

  /* Contacto sección */
  .contact-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-col {
    margin-bottom: 1rem;
  }

  /* Footer: dos columnas pero más compactas */
  .footer-inner {
    justify-content: space-between;
    gap: 1.5rem;
  }

  .footer-copy-bar p {
    text-align: center;
    margin-right: 0;
  }

  .wh-br {
    display: inline; /* aquí sí rompe la línea */
  }
}

/* Mobile chico: botones lado a lado sin encimarse */

@media (max-width: 480px) {
  .hero-cta {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .hero-cta .btn-primary,
  .hero-cta .btn-secondary {
    flex: 1 1 0;
    max-width: 160px;
    font-size: 0.85rem;
    padding: 0.65rem 0.8rem;
    white-space: nowrap;
  }
}
